﻿using System.ComponentModel.DataAnnotations.Schema;

public class QHSELoginModel:ModelBase
{
    /// <summary>
    /// 身份证号
    /// </summary>
    [MaxLength(18)]
    public string? IdCard { get; set; } = "";


    /// <summary>
    /// 手机号码
    /// </summary>
    [MaxLength(255)]
    public string? Mobile { get; set; } = "";

    /// <summary>
    /// 用户ID
    /// </summary>
    [MaxLength(255)]
    [Key]
    public string UserId { get; set; } = "";
    /// <summary>
    /// 权限ID
    /// </summary>
    [MaxLength(255)]
    public string? AuthId { get; set; } = "";
    /// <summary>
    /// 用户真名
    /// </summary>
    [MaxLength(255)]
    public string? UserName { get; set; } = "";
    /// <summary>
    /// 用户真名
    /// </summary>
    [MaxLength(255)]
    public string? RealName { get; set; } = "";

    /// <summary>
    /// 中油邮箱
    /// </summary>
    [MaxLength(255)]
    public string? Email { get; set; } = "";
    /// <summary>
    /// 标志
    /// </summary>
    [MaxLength(1000)]
    public string? Token { get; set; } = "";
    /// 权限标志
    [MaxLength(1000)]
    public string? Permission { get; set; } = "";
    /// 标志
    [MaxLength(1000)]
    public string? Role { get; set; } = "";
    /// <summary>
    /// 登录时间
    /// </summary>
    [MaxLength(255)]
    public string? LoginTime { get; set; } = "";
    /// <summary>
    /// 登录IP
    /// </summary>
    [MaxLength(255)]
    public string? LoginIp { get; set; } = "";
    /// <summary>
    /// 二级组织机构ID
    /// </summary>
    [MaxLength(255)]
    public string? SecondOrganizationId { get; set; } = "";
    /// <summary>
    /// 二级组织机构名
    /// </summary>
    [MaxLength(255)]
    public string? SecondOrganizationName { get; set; } = "";
    /// <summary>
    /// 三级组织机构ID
    /// </summary>
    [MaxLength(255)]
    public string? ThirdOrganizationId { get; set; } = "";
    /// <summary>
    /// 三级组织机构名
    /// </summary>
    [MaxLength(255)]
    public string? ThirdOrganizationName { get; set; } = "";
    /// <summary>
    /// 当前组织机构ID
    /// </summary>
    [MaxLength(255)]
    public string? CurrentOrganizationId { get; set; } = "";
    /// <summary>
    /// 当前组织机构名
    /// </summary>
    [MaxLength(255)]
    public string? CurrentOrganizationName { get; set; } = "";
    public List<string>? Permissions { get; set;}
    /// <summary>
    /// 具备应用信息
    /// </summary>
    public List<UserInfoApplicationModel> Apps { get; set; } = new List<UserInfoApplicationModel>();
    /// <summary>
    /// 登录菜单信息（AntDesign）
    /// </summary>
    public List<UserInfoMenuModel> Menus { get; set; } = new List<UserInfoMenuModel>();

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<QHSESysLogin, QHSELoginModel>()
            .ForMember(d => d.UserId, options => options.MapFrom(s => s.UserId));

        profile.CreateMap<QHSELoginModel, QHSESysLogin>()
            .ForMember(d => d.UserId, options => options.MapFrom(s => s.UserId));
    }
}

